package com.druid.app;

import com.druid.app.model.Student;
import com.druid.app.service.StudentService;
import com.druid.app.service.impl.StudentServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApplication {
    public static  void main(String[] args){
        //testAnnotation();
        testXml();
    }

    public static void testXml(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        StudentServiceImpl serviceImpl = ac.getBean("studentService", StudentServiceImpl.class);
        Student stu= new Student(1,"10000001","测试",25,1);
        serviceImpl.save(stu);
        Student stu1 = serviceImpl.findStudentByStuId("10000001");
        if(stu1!= null) {
            System.out.println(stu1.toString());
        }
    }
}
